package ${model.packageName}.${model.modulePackage}.${model.modelL}.mapper;

import ${model.packageName}.${model.modulePackage}.${model.modelL}.domain.${model.model};
import java.util.List;	

/**
 * ${model.comment} 数据层
 * 
 * @author ${model.author}
 * @date ${date}
 */
public interface ${model.model}Mapper 
{

	/**
     * 查询${model.comment}信息
     * 
     * @param id ${model.comment}ID
     * @return ${model.comment}信息
     */
	public ${model.model} select${model.model}ById(Integer id);
	
	/**
     * 查询${model.comment}列表
     * 
     * @param ${model.model} ${model.comment}信息
     * @return ${model.comment}集合
     */
	public List<${model.model}> select${model.model}List(${model.model} ${model.modelL});
	
	/**
     * 查询所有${model.comment}
     * 
     * @return ${model.comment}列表
     */
    public List<${model.model}> selectAll();
	/**
     * 新增${model.comment}
     * 
     * @param ${model.model} ${model.comment}信息
     * @return 结果
     */
	public int insert${model.model}(${model.model} ${model.modelL});
	
	/**
     * 修改${model.comment}
     * 
     * @param ${model.modelL} ${model.comment}信息
     * @return 结果
     */
	public int update${model.model}(${model.model} ${model.modelL});
	 /**
     * 批量修改
     * @param list
     * @return
     */
   public int batchUpdate(List<${model.model}> list);
	/**
     * 删除${model.comment}
     * 
     * @param id ${model.comment}ID
     * @return 结果
     */
	public int delete${model.model}ById(Integer id);
	
	/**
     * 批量删除${model.comment}
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	public int batchDelete${model.model}(Integer[] ids);
	
    /**
     * 批量添加
     * @param list
     * @return
     */
   public int batchAdd(List<${model.model}> list);
   
#foreach($field in $fieldList)
#if($field.existsMethod)
	/**
     * 校验${field.comment}是否唯一,
     * 
     * @param ${field.field} ${field.comment}
     * @return 大于1已存在
     */ 
    public int check${field.fieldUp}Unique(@Param("${field.field}")String ${field.field},@Param("id")String id);
#end
#if($field.findBy)
	/**
     * 根据${field.comment}查询
     * 
     * @param ${field.field} ${field.comment}
     * @return
     */ 
    public ${model.model} select${model.model}By${field.fieldUp}(String ${field.field});
#end
#end
}